package com.toune.villager.model

import android.content.Context
import androidx.lifecycle.MutableLiveData
import com.toune.dltools.http.DLHttp
import com.toune.dltools.http.IDLHttpCallBack
import com.toune.dltools.ui.DLBaseViewModel
import com.toune.villager.Api
import com.toune.villager.bean.GoodsTypeBean

class LifeModel : DLBaseViewModel() {

    val goodsTypeBeanValue = MutableLiveData<MutableList<GoodsTypeBean.RowsBean>>()
    fun getGoodsType() {
        DLHttp.get(Api.GetGoodsTypeUrl)
            .buildByJson(object : IDLHttpCallBack<GoodsTypeBean>() {
                override fun success(t: GoodsTypeBean) {
                    goodsTypeBeanValue.postValue(t.rows)
                }

            })
    }
}